-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added multifile support #182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fix build errors in tests ;)
SocietalConstructionTool/Compiler/Typechecker/SctTableVisitor.cs
Outdated
Show resolved
Hide resolved
I think this is a big enough feature that we need immediate tests on it to ensure it actually works. If we had other work waiting for this to be approved i would do it now, but we might as well get it in before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need tests
The split file tests cannot be run asynchronously because the generated code may match in content but differ in order. This results in the verified files causing an error. |
// Reset the parser to be able to type check the file later. | ||
parsers[file].Reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to reset the parser here.
Visitors act on the tree after parsing has happened.
// Reset the parser because its good practice. | ||
parsers[file].Reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do however need to reset the parser here, since the translator is a listener, so it runs while the parse tree is being generated.
// RunFiles is run for each file, and passing files to CompileSct only passes the file that triggered the test. | ||
// This method is used to get all files to pass to CompileSct. | ||
private static string[] GetFiles() | ||
{ | ||
return Files.SelectMany(f => f).ToArray(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we generate two identical snapshots. Wouldn't it be better to just remove the dynamic stuff from this test so it functions as a single test case instead of two?
All that needs to be done is to remove the files
argument.
Closes #132